import { Component } from '@angular/core';
import { IonicPage, NavController, NavParams } from 'ionic-angular';
import {BtDataService} from "../../bt-data.service";
@IonicPage()
@Component({
  selector: 'page-bs-europe',
    template: `
    <bt-region-match [(type)]="type" [(code)] = "code" (toMatch)="goMatchList($event)" (toLeague)="goLeaguePage($event)"></bt-region-match>
  `
})
export class BsEuropePage {

    code=1;
    type;
    constructor(public navCtrl: NavController, public navParams: NavParams) {
    }

    ionViewDidLoad() {
        //console.log('ionViewDidLoad BsEuropePage',this.navParams);
        this.type = +this.navParams.get('type') || 1;
    }

    //跳转到国家联赛列表
    goMatchList($event){
        this.navCtrl.parent.push('BsMatchListPage',$event);
    }

    //联赛首页，leagueId
    goLeaguePage($event){
        this.navCtrl.parent.push('LeagueTabsPage',{leagueId:$event});
    }
}
